﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FusionDotNet
{
    /// <summary>
    /// Contains the result of an AuthenticationCommand.
    /// </summary>
    public class AuthenticationResult : CommandResult
    {
        /// <summary>
        /// Default constructor. 
        /// </summary>
        public AuthenticationResult() { }

        internal AuthenticationResult(string token)
        {
            if (!String.IsNullOrEmpty(token))
            {
                AuthenticationToken = new AuthenticationToken(token);
                IsAuthenticated = true;
            }
            else
            {
                IsAuthenticated = false;
            }
        }

        /// <summary>
        /// The AuthenticationToken returned from the call to the Google API.
        /// </summary>
        public AuthenticationToken AuthenticationToken { get; private set; }

        /// <summary>
        /// Helper method to quickly determine the success of failure of the AuthenticationCommand.
        /// </summary>
        public bool IsAuthenticated { get; private set; }
    }
}
